
package com.doc2video.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.doc2video.common.Result;
import com.doc2video.dto.UserLoginDTO;
import com.doc2video.dto.UserRegisterDTO;
import com.doc2video.entity.User;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户Service接口
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     */
    Result<String> register(UserRegisterDTO registerDTO);

    /**
     * 用户登录
     */
    Result<String> login(UserLoginDTO loginDTO, HttpServletRequest request);

    /**
     * 用户退出
     */
    Result<String> logout(HttpServletRequest request);

    /**
     * 获取当前用户信息
     */
    Result<User> getCurrentUser(HttpServletRequest request);

    /**
     * 更新用户信息
     */
    Result<String> updateUserInfo(User user, HttpServletRequest request);

    /**
     * 修改密码
     */
    Result<String> changePassword(String oldPassword, String newPassword, HttpServletRequest request);

    /**
     * 根据用户名查询用户
     */
    User getByUsername(String username);
}
